//
//  LoginItem.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/16.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "LoginItem.h"

@implementation LoginItem

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    WeakSelf
    self.line = [[UIView alloc] init];
    _line.backgroundColor = UIColorWhite;
    [self addSubview:_line];
    [_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(rateWidth(50));
        make.right.equalTo(self).offset(-rateWidth(50));
        make.bottom.equalTo(self);
        make.height.equalTo(@(rateHeight(2)));
    }];
    
    self.icon = [[UIImageView alloc] init];
    [_icon sizeToFit];
    [self addSubview:_icon];
    [_icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.centerX.equalTo(weakSelf.line.mas_left).offset(rateWidth(35));
    }];
    
    self.textField = [[UITextField alloc] init];
    _textField.textColor = UIColorWhite;
    _textField.font = UIFontSystem(15);
    [self addSubview:_textField];
    [_textField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.icon);
        make.left.equalTo(weakSelf.line).offset(rateWidth(70));
        make.size.mas_offset(CGSizeMake(rateWidth(530), rateHeight(70)));
    }];
}

@end
